#include "server.hpp"


int main()
{
    Socket client;
    if (client.CreateClient(8080, "127.0.0.1") == false) ERR_LOG("create client error");
    
    DBG_LOG("connect success");
    int cnt = 100;
    while (cnt--)
    {
        std::string str = "hello world";
        client.Send((void*)str.c_str(), str.size());


        char ret[1024];
        int n = client.Read(ret, sizeof(ret) - 1);
        if (n > 0)
        {
            ret[n] = 0;
            DBG_LOG("recv %s", ret);
        }
        sleep(1);
    }

    sleep(100);

    return 0;
}